package battleship_server;

/**
 *
 * @author omar
 */
public class Coordinate {

    private boolean ship;
    private boolean hit;
    private int shipType;

    public Coordinate() {
        this.ship = false;
        this.hit = false;
    }

    public boolean placeShip(int shipType) {
        if (shipType > 6 || shipType < 1) {
            return false;
        }

        this.ship = true;
        this.shipType = shipType;
        return true;
    }

    public boolean receivesHit() {
        return (hit = ship);
    }

    public boolean isAvailable() {
        return !ship;
    }
    
    public int getShipType(){
        return shipType;
    }
}
